package main

import (
	"github.com/gin-gonic/gin"
	"log"
)

func main() {
	r := gin.Default()
	r.POST("/get/:id", func(ctx *gin.Context) {
		// query param
		queryParam := ctx.Query("name")
		log.Printf("queryParam=%v\n", queryParam)

		// query param of map
		queryMapParam := ctx.QueryMap("friends")
		log.Printf("queryMapParam=%v\n", queryMapParam)

		// query body maps
		queryBodyMap := ctx.PostFormMap("family")
		log.Printf("queryBodyMap=%v\n", queryBodyMap)

		ctx.String(200, "success")
	})

	r.Run(":8080")
}
